package com.kingmed.kmss.admin.modules.sys.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.kingmed.kmss.admin.modules.sys.model.SysFile;
import com.kingmed.kmss.admin.modules.sys.vo.ImageVo;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * <p>
 * 文件信息 服务类
 * </p>
 *
 * @author csw
 * @since 2023-04-17
 */
public interface ISysFileService extends IService<SysFile> {


    /**
     * 文件上传
     * @param uploadFile
     * @param filePath
     * @param fileType
     * @return
     * @throws Exception
     */
    SysFile upload(MultipartFile uploadFile, String filePath, String fileType) throws Exception;

    /**
     * 文件上传
     * @param uploadFile
     * @param fileType
     * @return
     * @throws Exception
     */
    SysFile upload(MultipartFile uploadFile, String fileType) throws Exception;

    /**
     * 文件上传
     * @param imageVo
     * @return
     */
    SysFile upload(ImageVo imageVo);

    /**
     * 删除文件
     * @Description 删除文件
     */
    boolean delete(String fileId);

    /**
     * 批量删除文件
     * @Description 删除文件
     */
    boolean delete(List<String> fileIds);

    /**
     * 文件下载
     * @param response
     * @param fileId
     */
    void downLoadAuth(HttpServletResponse response, String fileId);

    /**
     * 文件批量下载并压缩成zip
     * @param fileIds
     * @param response
     */
    void downLoadBatchToZip(List<String> fileIds, HttpServletResponse response) throws Exception;
}
